﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Action_Default : BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        UserPower.CheckAction((int)FreeHouse.Power.Actions.TAction.List);
        if (!IsPostBack)
        {
            BindData();
        }
    }

    protected void BindData()
    {
        ActionClasss.DataSource = new FreeHouse.BLL.TActionClass().GetList(100000, "", "ClassName asc");
        ActionClasss.DataTextField = "ClassName";
        ActionClasss.DataValueField = "ActionClassID";
        ActionClasss.DataBind();
        ActionClasss.Items.Insert(0, new ListItem("请选择...", "0"));
    }

    protected void view_Click(object sender, EventArgs e)
    {
        string where = "";
        int actionClassId;
        int.TryParse(ActionClasss.SelectedValue, out actionClassId);
        where = actionClassId == 0 ? "" : " ActionClassID="+actionClassId.ToString();
        list.DataSource = new FreeHouse.BLL.TAction().GetList(0, where, "MethodName asc");
        list.DataBind();
    }
}
